package com.dolphin.aiagentplatform.utils;

import com.dolphin.aiagentplatform.common.BaseResponse;
import com.dolphin.aiagentplatform.constant.ResponseCodeConst;

/**
 * 响应工具类
 */
public class ResponseUtils {


    public static <T> BaseResponse<T> success(T data) {
        return new BaseResponse<>(0, data, "ok");
    }


    public static <T> BaseResponse<T> error(ResponseCodeConst responseCodeConst) {
        return new BaseResponse<>(responseCodeConst);
    }


    public static <T> BaseResponse<T> error(int code, String message) {
        return new BaseResponse<>(code, null, message);
    }


    public static <T> BaseResponse<T> error(ResponseCodeConst responseCodeConst, String message) {
        return new BaseResponse<>(responseCodeConst.getCode(), null, message);
    }
}
